package com.anxin.system.dto;

import jakarta.validation.constraints.*;
import lombok.Data;

import java.time.LocalDate;

@Data
public class PatientInfoDTO {

    @NotBlank(message = "ID不能为空")
    private String id;

    @NotBlank(message = "用户ID不能为空")
    private String userId;

    @NotBlank(message = "真实姓名不能为空")
    private String realName;

    @NotNull(message = "性别不能为空")
    @Min(value = 0, message = "性别必须为0或1")
    @Max(value = 1, message = "性别必须为0或1")
    private Integer gender;

    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @NotBlank(message = "手机号不能为空")
    private String phone;

    @Email(message = "邮箱格式不正确")
    private String email;

    @NotNull(message = "出生日期不能为空")
    private LocalDate birthDate;

    @Pattern(regexp = "^[1-9]\\d{5}(?:18|19|20)\\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12][0-9]|3[01])\\d{3}[\\dXx]$",
            message = "身份证号格式不正确")
    @NotBlank(message = "身份证号不能为空")
    private String idCard;

    @NotBlank(message = "地址不能为空")
    private String address;



}
